﻿using Newtonsoft.Json;

namespace TestPrint.XMLhelp
{
    public class JsonHelper
    {
        public static T DeserializeObject<T>(string szJson)
        {
            return JsonConvert.DeserializeObject<T>(szJson);
        }

        public static T DeserializeAnonymousType<T>(string szJson, T instance)
        {
            return JsonConvert.DeserializeAnonymousType<T>(szJson, instance);
        }

        public static string SerializeObject(object obj)
        {
            return JsonConvert.SerializeObject(obj);
        }
    }
}
